package com.alfayun.fiscalriskanalysis.user;

import java.util.List;

import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

public interface UserRepository extends PagingAndSortingRepository<User, Integer> {

	@Modifying
	@Query("delete #{#entityName} e where id = ?1")
	int deleteById(int id);

	List<User> findByRole(Role admin);

	User findByUsername(String username);

}
